package com.nbjtjc.safe.activiti.model;

import com.nbjtjc.safe.model.danger.DangerInspectPublic;
import com.nbjtjc.safe.model.emg.EmgPlanPublic;
import org.activiti.engine.impl.persistence.entity.TaskEntity;

import java.util.*;

/**
 * @auther guqianbin
 * @date 2018/3/28 14:58
 **/
public class MyTask {
    private String name;
    private String id;
    private String processInstanceId;
    private String processDefId;
    private String executionId;
    private String taskDefinitionKey;
    private Date createTime;

    private Date endTime;

    private String userId;
    private String comment="";
    private String userName;
    private ExtActNode extActNode;
    private EmgPlanPublic emgPlanPublic;
    private String result="";
    private DangerInspectPublic dangerInspectPublic;
    private String subProcessStartUserId;
    /**
     *某个任务是否改派过
     */

    private Boolean hasReassign=false;

    /**
     * 任务所属；流程是否完结
     */
    private Boolean processFinish=false;
    private ExtActTaskReassign extActTaskReassign;
    /**
     * 正在运行的隐患流程
     */
    private DangerProcess dangerProcess;

    public DangerProcess getDangerProcess() {
        return dangerProcess;
    }

    public void setDangerProcess(DangerProcess dangerProcess) {
        this.dangerProcess = dangerProcess;
    }

    public Boolean getProcessFinish() {
        return processFinish;
    }

    public void setProcessFinish(Boolean processFinish) {
        this.processFinish = processFinish;
    }

    public Boolean getHasReassign() {
        return hasReassign;
    }

    public void setHasReassign(Boolean hasReassign) {
        this.hasReassign = hasReassign;
    }

    public ExtActTaskReassign getExtActTaskReassign() {
        return extActTaskReassign;
    }

    public void setExtActTaskReassign(ExtActTaskReassign extActTaskReassign) {
        this.extActTaskReassign = extActTaskReassign;
    }

    public String getSubProcessStartUserId() {
        return subProcessStartUserId;
    }

    public void setSubProcessStartUserId(String subProcessStartUserId) {
        this.subProcessStartUserId = subProcessStartUserId;
    }

    public DangerInspectPublic getDangerInspectPublic() {
        return dangerInspectPublic;
    }

    public void setDangerInspectPublic(DangerInspectPublic dangerInspectPublic) {
        this.dangerInspectPublic = dangerInspectPublic;
    }

    public String getProcessDefId() {
        return processDefId;
    }

    public void setProcessDefId(String processDefId) {
        this.processDefId = processDefId;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public ExtActNode getExtActNode() {
        return extActNode;
    }

    public void setExtActNode(ExtActNode extActNode) {
        this.extActNode = extActNode;
    }

    public EmgPlanPublic getEmgPlanPublic() {
        return emgPlanPublic;
    }

    public void setEmgPlanPublic(EmgPlanPublic emgPlanPublic) {
        this.emgPlanPublic = emgPlanPublic;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getProcessInstanceId() {
        return processInstanceId;
    }

    public void setProcessInstanceId(String processInstanceId) {
        this.processInstanceId = processInstanceId;
    }

    public String getExecutionId() {
        return executionId;
    }

    public void setExecutionId(String executionId) {
        this.executionId = executionId;
    }

    public String getTaskDefinitionKey() {
        return taskDefinitionKey;
    }

    public void setTaskDefinitionKey(String taskDefinitionKey) {
        this.taskDefinitionKey = taskDefinitionKey;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public static MyTask getMyTask(TaskEntity taskEntity){
        MyTask myTask=new MyTask();
        myTask.setId(taskEntity.getId());
        myTask.setName(taskEntity.getName());
        myTask.setCreateTime(taskEntity.getCreateTime());
        myTask.setExecutionId(taskEntity.getExecutionId());
        myTask.setProcessInstanceId(taskEntity.getProcessInstanceId());
        myTask.setTaskDefinitionKey(taskEntity.getTaskDefinitionKey());
        return myTask;
    }
}
